﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace AwesomeEnginePC.Extentions
{
    public static class ExtMedSQL
    {
        /// <summary>
        /// Adds a parameter to the SqlCommand. Useful shortcut for setting up parameters in data accessers
        /// </summary>
        /// <param name="command"></param>
        /// <param name="parameterName"></param>
        /// <param name="value"></param>
        public static void AddParam(this SqlCommand command, string parameterName, object value)
        {
            command.Parameters.AddWithValue(parameterName, value);
        }

        /// <summary>
        /// Adds a parameter to the SqlCommand. Useful shortcut for setting up parameters in data accessers
        /// </summary>
        /// <param name="command"></param>
        /// <param name="parameterName"></param>
        /// <param name="value"></param>
        public static void AddParam(this MySql.Data.MySqlClient.MySqlCommand command, string parameterName, object value)
        {
            command.Parameters.AddWithValue(parameterName, value);
        }
    }
}
